#include "iostream"
using namespace std;

class Point
{
public:
	void setP(int _x0, int _y0)
	{
		x0 = _x0;
		y0 = _y0;
	}
	int getX()
	{
		return x0;
	}
	int getY()
	{
		return y0;
	}
private:
	//定义圆心和圆的半径
	int x0;
	int y0;
};

class  AdvCircle
{
public:
	void setCircle(int _x1, int _y1, int _r)
	{
		x1 = _x1;  
		y1 = _y1;
		r = _r;
	}
	void judge(int x0, int y0)
	{
		int a = (x1-x0)*(x1-x0) + (y1-y0)*(y1-y0) - r*r;
		if (a > 0)
		{
			cout<<"点在圆外";
		}
		else
		{
			cout<<"点在圆内";
		}
	}

	//类做函数参数的时候，类封装了属性和方法，在被调用函数里面， 不但可以使用属性，而且可以使用方法（成员函数）；
	//这也是面向对象和面向过程的一个重要区别。。。。
	void judge(Point &p)
	{
		int a = (x1-p.getX())*(x1-p.getX()) + (y1-p.getY())*(y1-p.getY()) - r*r;
		if (a > 0)
		{
			cout<<"点在圆外";
		}
		else
		{
			cout<<"点在圆内";
		}
	}
private:
	//定义圆心和圆的半径
	int x1;
	int y1;
	int r;
	

};

void main()
{
	Point myp;
	AdvCircle c1;

	myp.setP(1, 1);
	c1.setCircle(2, 2, 3);
	//c1.judge(myp);

	c1.judge(1, 1);

	system("pause");
}



void main111()
{	
	//定义点
	int x0 = 1;
	int y0 = 1;

	//定义圆心和圆的半径
	int x1 = 2;
	int y1 = 2;

	int r = 3;

	int a = (x1-x0)*(x1-x0) + (y1-y0)*(y1-y0) - r*r;
	if (a > 0)
	{
		cout<<"点在圆外";
	}
	else
	{
		cout<<"点在圆内";
	}
	system("pause");
}